package ejb;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

@MessageDriven(
		activationConfig = { @ActivationConfigProperty(
				propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(
				propertyName = "destination", propertyValue = "queue/pepe")
		}, 
		mappedName = "queue/pepe")


public class EjemploMDB2 implements MessageListener {

    public EjemploMDB2() {
    }
	
    public void onMessage(Message message) {
    	TextMessage textMessage = (TextMessage) message;
        try {
          System.out.println("Recibido Mensaje COLA PEPE: "+textMessage.getText());
        } 
        catch (JMSException e){
         e.printStackTrace();
        }
    }

}
